package com.zhzh.StudySpringBoot.domain;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 *
 *
 * @author zhangzhen
 * @version C10 2018年02月02日 
 * @since SDP V300R003C10
 */
public interface UserRepository extends JpaRepository<User, Long>
{

    User findByName(String name);

    User findByNameAndAge(String name, Integer age);

    @Query("from User u where u.name=:name")
    User findUser(@Param("name") String name);


}
